
package jweslley.ProblemSetVolumes.VolumeIV;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

import jweslley.Problem;
import jweslley.Problem.Status;

/**
 * http://icpcres.ecs.baylor.edu/onlinejudge/external/4/484.html
 *
 * @author  Jonhnny Weslley
 * @version 1.00, 19/10/2008
 */
@Problem(Status.Accepted)
public class TheDepartmentOfRedundancyDepartment {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		List<Integer> numbers = new LinkedList<Integer>();
		Map<Integer, Integer> counterTable = new HashMap<Integer, Integer>();
		int n;
		while (in.hasNext()) {
			n = in.nextInt();
			if (!numbers.contains(n)) {
				numbers.add(n);
			}
			counterTable.put(n, counterTable.containsKey(n) ? (counterTable.get(n) + 1) : 1);
		}
		for (Integer number : numbers) {
			System.out.printf("%s %s\n", number, counterTable.get(number));
		}
	}

}
